<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
	<title>用户登录-{:config('web.web_title')}</title>
	<meta name="keywords" content="{:config('web.web_keywords')}">
	<meta name="description" content="{:config('web.web_description')}">

	<link rel="stylesheet" type="text/css" href="{:config('web.cdn')}/static/index/login/vendor/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="{:config('web.cdn')}/static/index/login/fonts/font-awesome-4.7.0/css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="{:config('web.cdn')}/static/index/login/fonts/iconic/css/material-design-iconic-font.min.css">
	<link rel="stylesheet" type="text/css" href="{:config('web.cdn')}/static/index/login/css/util.css">
	<link rel="stylesheet" type="text/css" href="{:config('web.cdn')}/static/index/login/css/main.css">
	<link rel="stylesheet" type="text/css" href="{:config('web.cdn')}/static/index/layuitpl/layui/css/layui.css">

	<script src="{:config('web.cdn')}/static/index/login/vendor/jquery/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="{:config('web.cdn')}/static/index/layuitpl/layui/layui.js"></script>
	<script type="text/javascript" src="{:config('web.cdn')}/static/js/functions.js"></script>


</head>

<body>

	<div class="limiter">
		<div class="container-login100" style="background-image: url('{:config('web.cdn')}/static/index/login/images/bg-01.jpg');">
			<div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54">
				<form class="login100-form validate-form" onsubmit="return infosub();" action="" name="login_form" method="post" id="login_form">
					<span class="login100-form-title p-b-49">用户登录</span>

					<div class="wrap-input100 validate-input m-b-23" data-validate="请输入用户名">
						<span class="label-input100">用户名</span>
						<input class="input100" type="text" name="username" placeholder="请输入用户名" autocomplete="off">
						<span class="focus-input100" data-symbol="&#xf206;"></span>
					</div>

					<div class="wrap-input100 validate-input" data-validate="请输入密码">
						<span class="label-input100">密码</span>
						<input class="input100" type="password" name="password" placeholder="请输入密码">
						<span class="focus-input100" data-symbol="&#xf190;"></span>
					</div>

					<div class="text-right p-t-8 p-b-31">
						<a href="{:url('forget/index')}">忘记密码？</a>
					</div>

					<input type="hidden" name="from" value="" />
					<input type="hidden" name="action" id="login" value="login" />
					<input class="ck" name="remember" type="checkbox" checked="checked" value="1"/>两周内免登录
				
					<div class="container-login100-form-btn">
						<div class="wrap-login100-form-btn">
							<div class="login100-form-bgbtn"></div>
							<button class="login100-form-btn" type="submit">登 录</button>
						</div>
					</div>

					<div class="txt1 text-center p-t-54 p-b-20">
						<span>第三方登录</span>
					</div>

					<div class="flex-c-m">
						<!--<a href="#" class="login100-social-item bg1">-->
							<!--<i class="fa fa-wechat"></i>-->
						<!--</a>-->

						<a href="{:url('Authorize/qq')}" class="login100-social-item bg2">
							<i class="fa fa-qq"></i>
						</a>

						<!--<a href="#" class="login100-social-item bg3">-->
							<!--<i class="fa fa-weibo"></i>-->
						<!--</a>-->
					</div>
					

					<div class="flex-col-c p-t-25">
						<a href="{:url('user/register')}" class="txt2">立即注册</a>
					</div>
				</form>
			</div>
		</div>
	</div>
	<script>
		function infosub() {
			var url="{:url('user/login')}";
			var username = $("input[name=username]").val();
			var password = $("input[name=password]").val();
			if(!username){
				error("用户名不能空");
				return  false;
			}
			if(!password){
				error("密码不能空");
				return  false;
			}

			var data = $("form").serialize();
			$.post(url,data,function (e) {
				if(e.code == 200){
					success(e.msg);
					localStorage.setItem("token",e.token);
					setTimeout("location.href='{:url('User/index')}'",1000);
				}else {
					error(e.msg);
				}
			});
			return false;
		}
	</script>

</body>

</html>